package com.apes.scm.masterdata.product.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.scm.masterdata.product.model.ProductUomCategory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 *
 * @author xul
 * @create 2018-02-06 16:47
 */
public interface ProductUomCategoryRepository extends CustomRepository<ProductUomCategory, String> {

    @Query("SELECT T FROM ProductUomCategory T WHERE 1 = 1 and (id = :id or name like %:value%) ")
    Page<ProductUomCategory> find(@Param("id") String id, @Param("value") String value, Pageable pageable);
}
